<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Examples</title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<!-- iOS 设备 begin -->
<meta name="apple-mobile-web-app-title" content="标题">
<!-- 添加到主屏后的标题（iOS 6 新增） -->
<meta name="apple-mobile-web-app-capable" content="yes"/>

<script src="../js/rem.js"></script>
<link rel="stylesheet" href="../css/reset.css">
<link rel="stylesheet" href="../css/common.css">

<link rel="stylesheet" href="dome-css.css">

</head>
<body>
<div class="aaa">abc</div>
<!-- 
文档模板
<div class="domelist">
    <p>class: className</p>
    <p>描述文字</p>
    <div class="p-lable1">代码</div>

    <textarea class="code-value">代码</textarea>
    <button class="copybtn" onClick="copyUrl2(event)">点击复制代码</button>
</div>
 -->
<script type="text/javascript">
    function copyUrl2(e){
        console.log(e)
        var nowDom = e.srcElement;
        var parentDom = nowDom.parentElement;
        var valueDom = parentDom.getElementsByClassName('code-value')[0];
        valueDom.select();
        document.execCommand("Copy");
        alert("已复制好，可贴粘。");
    };
</script>
</body>
</html>